Method and system for generating and selectively outputting two types of ink vector data

ABSTRACT

A computer-implemented method is provided to selectively output two types of vector data representative of user-input strokes. Type one stroke objects are generated in a device including a position input sensor, on which a user operates a pointer to generate a type one stroke object representative of a stroke. A stroke starts at a pen-down time at which the pointer is placed on the position input sensor and ends at a pen-up time at which the pointer is removed from the position input sensor. Real-time rendering of a type one stroke object is started after the pen-down time of a stroke without waiting for the pen-up time. After completion of a type one stroke object through its pen-up time, the type one stroke object is converted to a type two stroke object, which is a set of curves defining a boundary of the stroke, and can be rendered.

BACKGROUND

Technical Field

The present invention is directed to methods and systems for generating and selectively outputting two types of ink vector data usable to reproduce strokes that are hand-drawn on a position input sensor.

Description of the Related Art

Various handwriting input systems are known that allow a user to input hand-drawn (freehand) data by using a pen-shaped device. For example, electromagnetic resonance type pen-tablet input systems are known, which allow input of hand-drawn data including associated pen pressure and pen tilt data. As further examples, electrostatic type pen input systems are known, which create capacitance between a pen-shaped input device and a (tablet) sensor surface similarly to how capacitance is created between a finger and the sensor surface.

Still further, input systems that output relatively simple information such as gesture information derived from a collection of determined positions of an input element are known.

Hand-drawn data or stroke (path or trace) data inputted by a pen-shaped implement is stored in a defined data type or format, which can be used (e.g., displayed) on various types of devices and applications, such as ink messaging, ink archiving and retrieval, e-mail, photo annotation, and remote video conferencing applications. Such hand-drawn data is called digital ink or ink data. Ink data is an intermediate data existing between raw data, which consists of coordinate values of user-inputted positions, and raster data, which consists of pixel data which can be directly rendered on a display as an image. As such, most ink data are vector data. Examples of different types of ink data are described in the following non-patent literature DOCUMENTS (D1) through (D5):

-   (D1) W3C, Recommendation 20, September 2011, “Ink Markup Language     (InkML)” (URL—http://www.w3.org/TR/2011/REC-InkML-20110920/) -   (D2) Microsoft Corporation, et al., “Ink Serialized Format     Specification” 2007     (URL—http//download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/InkSerializedFormat(ISF)Specification.pdf) -   (D3) W3C Working Draft 11, February 2014, “Scalable Vector Graphics     (SVG) 2” (URL—http://www.w3.org/TR/SVG2/); W3C Recommendation, 16     Aug. 2011, “Scalable Vector Graphics (SVG) 1.1 (Second Edition)”     (URL—http://www.w3.org/TR/2011/REC-SVG11-201110816/) -   (D4) W3C, “HTMLS A vocabulary and associated APIs for HTML and XHTML     W3C Recommendation 28 Oct. 2014” (URL—http://www.w3.org/TR/htm15/) -   (D5) Slate Corporation, et al., “JOT—A Specification for an Ink     Storage and Interchange Format”, Version 1.0, September 1996

For example, the InkML (D1) and ISF (D2) data structures represent stroke data inputted by a pen-type device in a manner sharable amongst different applications. SVG (D3) provides a Web standard that permits drawing of a path defined by user-input control points as vector data, regardless of what type of pen device is used as an input device.

The ink data described in (D1) through (D5) all define geometric information needed to reproduce a stroke (or a trace or a path) formed by movement of a pen or a finger. Such geometric information is herein collectively called a “stroke object.” A stroke object is vector data information whose data structure includes a set of point or control point coordinates that are used collectively to reproduce a stroke (or a trace or a path) formed by movement of a pen or a finger.

SUMMARY

According to various embodiments, the present invention offers methods and systems for generating and selectively outputting two types of vector data representative of user-input strokes depending on an output request. The embodiments are usable with various types of stroke objects defined in (D1)-(D5) above, and provide technical solutions that were previously not available in (D1)-(D5). For example, the stroke objects defined in (D1)-(D5) or their modifications may be used as one of the two types of stroke objects, which may be converted to generate the other of the two types of stroke objects according to various embodiments of the present invention.

According to one aspect, a computer-implemented method is provided for selectively outputting two types of vector data representative of user-input strokes. Type one stroke objects are generated in a device including a position input sensor, wherein the type one stroke objects represent strokes formed by a user operating a pointer relative to the position input sensor. Each type one stroke object represents a stroke starting at a pen-down time at which the pointer is detectably placed relative to the position input sensor and ending at a pen-up time at which the pointer is removed from the position input sensor. Real-time rendering of a type one stroke object is started after the pen-down time of a stroke represented by said type one stroke object without waiting for completion of the stroke at the pen-up time. After completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, the type one stroke object is converted to a type two stroke object, wherein the type two stroke object is a set of curves defining a boundary of the stroke. The type two stroke object, instead of the corresponding type one stroke object, is rendered after the pen-up time of the stroke represented by said type one stroke object.

According to a further aspect, type one stroke objects are generated by: i) sequentially receiving pen event data detected by the position input sensor; ii) sequentially generating point objects based on coordinate values included in the received pen event data, wherein the point objects serve as control points for interpolating curve segments according to a defined curve interpolation algorithm (e.g., Catmull-Rom Curve algorithm) to form a type one stroke object and wherein each point object is associated with width information; and iii) generating a type one stroke object as a collection of the point objects that define a stroke represented by the type one stroke object.

According to another aspect, each point object is additionally associated with color information and transparency information.

According to yet another aspect, the conversion of the type one stroke object to the type two stroke object includes: i) using a clipping algorithm (e.g., the Vatti clipping algorithm) to simplify a shape of the type one stroke object into one or more simplified shapes that do not include self-intersection, wherein each simplified shape is defined by boundary points and the curves formed between the boundary points; and ii) outputting the one or more simplified shapes as the type two stroke object comprised of the set of curves (e.g., Bezier curves) defining the boundary of the stroke.

According to a further aspect, the type one stroke objects and the type two stroke objects are stored, and selectively outputted depending on an output request. For example, the type one stroke objects may be outputted in response to an output request from applications such as a real-time drawing application and a text recognition application, and the type two stroke objects may be outputted in response to an output request from applications such as a bulk drawing application and a portable document format (PDF) application.

According to another aspect, a color value of each boundary point may be adjusted based on the color value and a transparency value of the boundary point. Then the boundary points associated with adjusted color values may be outputted in response to an output request from a portable document format (PDF) application.

According to a still further aspect, a system is provided for selectively outputting two types of vector data representative of user-input strokes. The system includes a memory device, and a processor coupled to the memory device. The processor is configured to receive pen event data from a position input sensor, wherein the pen event data is representative of strokes formed by a user operating a pointer relative to the position input sensor. The processor generates type one stroke objects based on the received pen event data, wherein the type one stroke objects represent the strokes, respectively. The processor starts real-time rendering of a type one stroke object after the pen-down time of a stroke represented by said type one stroke object without waiting for completion of the stroke at the pen-up time. The processor, after completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, converts the type one stroke object to a type two stroke object. The processor renders the type two stroke object, instead of the corresponding type one stroke object, after the pen-up time of the stroke represented by said type one stroke object.

According to another aspect, a computer-implemented method is provided for selectively outputting two types of vector data representative of user-input strokes. Type one stroke objects are generated. Real-time rendering of a type one stroke object after the pen-down time of a stroke represented by said type one stroke object is started without waiting for completion of the stroke at the pen-up time. After completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, the type one stroke object is converted to a type two stroke object, wherein the type two stroke object is a set of boundary points that represent a boundary of the entire stroke. The type two stroke object, instead of the corresponding type one stroke object, is rendered after the pen-up time of the stroke represented by said type one stroke object.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIGS. 1A and 1B are diagrams illustrating an overall system including a position input sensor, into which hand-drawn data is inputted, and from which raw position data, type one vector data suitable for real-time/fast rendering, or type two vector data suitable for bulk manipulation (zoom, scroll, rotation, etc.) is selectively outputted.

FIG. 2 is a diagram illustrating relationships and conversion (transformation) directions amongst pen event data (or raw position data), type one vector data, type two vector data, and rasterized image data.

FIG. 3 is a flow chart illustrating a general method of selectively outputting at least type one vector data and type two vector data depending on an output request.

FIG. 4 is a functional block diagram of an ink data processing system including a type one vector data generator, a type two vector data generator (a type one to type two converter), and a selector that selectively outputs the type one vector data or the type two vector data.

FIG. 5 is a functional block diagram of the type one vector data generator of FIG. 4.

FIG. 6 illustrates the processing performed at points “A” through “D” in the type one vector data generator of FIG. 5.

FIG. 7 is a flow chart illustrating a sample routine performed by the type one vector data generator of FIG. 5.

FIG. 8 is a functional block diagram of a real-time renderer and a graphic processing section, which together perform real-time rendering of type one vector data.

FIGS. 9A-9D illustrate processes of generating and rendering a type one stroke object.

FIG. 10 is a functional block diagram of the type two vector generator (the type one to type two converter) of FIG. 4.

FIG. 11 is a schematic flow diagram illustrating conversion of a type one stroke object including self-intersection into a type two stroke object consisting of two shapes including no self-intersection.

FIG. 12 is a flow chart illustrating a sample routine performed by the type two vector data generator of FIG. 10.

FIG. 13 is a flow chart illustrating a method of generating type two vector data, by adjusting their color values based on transparency values of the original type one vector data, to be embedded in a PDF file.

FIGS. 14A and 14B are schematic diagrams illustrating the method of generating type two vector data as in FIG. 13.

FIG. 15 illustrates a process of selectively outputting type one vector data, type two vector data, or type zero data (raw pen event data) depending on an output request.

DETAILED DESCRIPTION

As used herein, the following terms have the following general meaning.

“Pen event data” (see FIG. 4) means data inputted based on a user's hand drawing motion. Pen event data may be the raw (position) data as inputted by a given input device 10 a, or data that has been processed from the raw data (by a motion event/touch input subsystem 21, for example). While all pen event data are expected to have at least the positional information (e.g., XY coordinates) of a stroke drawn by a user, pen event data is device-dependent and may include additional attributes (e.g., pen pressure data “P”, pen rotation or tilt angle data, etc.) that are specific to each type of input device. For example, pen event data received from input devices capable of detecting pen pressure is different from pen event data received from input devices incapable of detecting pen pressure.

“Ink data” means a collection of objects that are derived from pen event data. Ink data captures strokes (paths, traces) based on pen event data and is typically in the form of vector data, which is a type of intermediate data existing between raw data (or pen event data) and raster data (or pixel data) that can be directly rendered on a display as an image. As such ink data describes not only the geometry/shape of the strokes but also their properties, such as colors, transparency values, pressure values, etc. Unlike pen event data, ink data is device-independent and can be shared by different types of devices including, for example, those devices that support pen pressure and/or pen rotation/tilt angle attributes and those devices that do not support these attributes.

One type of ink data disclosed in co-assigned U.S. patent application Ser. No. 14/838,182, filed Nov. 19, 2014, which is incorporated herein by reference (hereinafter “the '182 application”), includes generally four types of objects: stroke objects, metadata objects, drawing style objects, and manipulation objects. Briefly, a “stroke object” defines a shape of a stroke obtained by a user operation of an input device. The “stroke,” “path,” “trace” and “CanvasPath” described in (D1)-(D5) described above are all stroke objects that can be supported in the ink data of the '182 application. A “metadata object” includes non-drawing related information that describes a stroke object, such as authorship, pen ID, locally obtained date and time information, location information obtained by GPS, etc. A “drawing style object” includes drawing-related information necessary to control or adjust the rendered shape (stroke width, stroke style or stroke pattern) and the rendered color of a stroke object when drawn, expressed, or rasterized on a display. A “manipulation object” is configured to execute a manipulative/modification operation (e.g., a slicing operation, enlargement operation, rotation operation, tilting operation, etc.) on the whole or a part of a pre-existing stroke object. Various embodiments of the present invention disclosed herein are usable and fully compatible with various types of ink data including the ink data disclosed in the '182 application.

FIGS. 1A and 1B are diagrams illustrating an overall system capable of generating and selectively outputting two types of ink vector data, in addition to the raw (pen event) data, depending on a particular output request or output destination, according to an exemplary embodiment of the present invention. The system includes a position input sensor 50, into which hand-drawn data is inputted based on an operation of an input device 10 a such as a stylus, pointer, etc. From a sensor controller 10 of the position input sensor 50, raw position data, type one vector data suitable for real-time rendering for example, or type two vector data suitable for bulk manipulation (zoom, scroll, rotation, etc.) and fast-bulk redraw for example is selectively outputted, depending on an output request (RT) from a particular application 300 as illustrated in FIG. 1B. In the illustrated non-limiting example of FIG. 1B, raw position data is outputted in response to an output request from a signature verification application. Type one vector data is outputted for real-time drawing (rendering) of the hand-drawn data as it is inputted by the input device 10 a, or in response to an output request from a text (character) recognition application. Type two vector data is outputted in response to an output request associated with bulk drawing manipulation, such as a zooming, rotating, scrolling, or tiling command to be applied to a set of stroke objects in bulk, or in response to an output request to have the vector data embedded in a PDF file.

The position input sensor 50 may be any one of various types of position input sensors including the electromagnetic type, capacitive type, and resistive type sensors as well known in the art. The position input sensor 50 is typically a part of a computer 1 including necessary hardware/software 100 to process operation of the position input sensor 50, such as a communication module, IO interface control, Sensor IC, CPU 20, memory (RAM) 30. The computer 1 also includes, or has access to, a graphic processor 40. It should be understood that the computer 1 may include various other components but detailed description thereof is not necessary for the purpose of the present disclosure.

FIG. 2 is a diagram illustrating relationships and conversion (transformation) directions amongst the pen event data (or raw position data), type one vector data, type two vector data, and rasterized image data.

In the illustrated example of FIG. 2, the pen event data entered to the position input sensor 50 includes XY coordinates of each entered position and a pressure data “P” associated with the entered position, which is indicative of a pressure value applied by the input device 10 a against a surface of the position input sensor 50 at the entered position.

A flow line 20 a indicates that the pen event data (X, Y, P) is used to generate type one vector data. The type one vector data includes one or more type one stroke objects 21, each being generated to represent a stroke hand-drawn by the input device 10 a on the position input sensor 50. The position input sensor 50 includes a matrix of electrodes 10 b. As shown in FIG. 1A, a type one stroke object is configured to represent a stroke (“st”) starting at a pen-down time at which the input device 10 a is detectably placed relative to the position input sensor 50 (“Down”) and ending at a pen-up time at which the input device 10 a is removed from the position input sensor 50. As such, type one stroke object 21 is defined by a series of points (or point objects) that are typically in the same sequential order as the sequential order in which the stroke is hand-drawn from its pen-down time to its pen-up time. Also, each of the points has width and/or transparency parameters associated with it, as will be described below. As illustrated in FIG. 2, type one stroke object 21 may include self-intersection 21 a, at which the stroke represented by type one stroke object 21 intersects itself.

A flow line 20 b indicates that type one vector data is typically not convertible back to the pen event data. Instead, in exemplary embodiments, type one vector data generated from the pen event data is continuously rendered in real time on a display or is stored in a memory device. The stored type one vector data may be used to generate type two vector data or may be selectively outputted to form rasterized data in response to an output request that calls for type one vector data.

A flow line 22 a indicates that type one vector data is used to generate, or is converted to, type two vector data suitable for bulk manipulation (zoom, scroll, rotation, etc.), for example. Type two vector data includes one or more type two stroke objects 23 that are respectively converted from type one stroke objects 21. A characteristic aspect of type two stroke object 23 is that, unlike type one stroke object 21 which may include self-intersection 21 a, type two stroke object 23 consists of one or more simple shapes 23 a, 23 b that do not include any self-intersection. The type two stroke object 23 is a set of curves defining a boundary of the stroke. In the example of FIG. 2, the type two stroke object 23 consists of the two simple shapes 23 a, 23 b, wherein the shape 23 a comprises a set of curves (e.g., Bezier curves) formed between boundary points V1-V10 defining an interior boundary of the stroke, and the shape 23 b comprises a set of curves formed between boundary points V1-V6 defining an interior boundary of the stroke. Type two vector data consisting of simple shapes is suited for bulk drawing and manipulation, such as zooming, rotating and tilting a (large) set of stroke objects in bulk.

A flow line 22 b indicates that type two vector data is typically not convertible back to type one vector data. Instead, in exemplary embodiments, type two vector data generated (converted) from type one vector data is stored in a memory device to be selectively outputted in response to an output request that calls for type two vector data, such as an output request for bulk drawing or an output request to embed stroke objects in a PDF file.

A flow line 24 a indicates that either type one vector data or type two vector data may be selectively outputted, depending on a particular output request from a particular application being executed, to form rasterized data consisting of pixel data that can be directly rendered on a screen.

A flow line 24 b indicates that rasterized data is typically not convertible back to either type one vector data or type two vector data. Similarly, flow line 20 b described above indicates that not only type one vector data but also type two vector data is typically not convertible back to the pen event data.

FIG. 3 is a flow chart illustrating a general method of selectively outputting at least type one vector data and type two vector data depending on an output request. As shown in FIG. 1B, in addition to type one and type two vector data, raw (position) data (or pen event data) may be selectively outputted depending on an output request. In step S31, type one vector data is generated based on pen event data inputted to the position input sensor 50 (see flow line 20 a in FIG. 2). In step S33, type two vector data is generated based on type one vector data (see flow line 22 a in FIG. 2). In step S35, at least type one vector data or type two vector data is selectively outputted depending on a particular output request.

FIG. 2 illustrates a sample type one stroke object 21 of type one vector data including self-intersection 21 a. Below, a method and a system for generating and real-time rendering of type one vector data are first described in reference to FIGS. 4-9D, followed by description of a method and a system for generating type two vector data in reference to FIGS. 4 and 10-14B.

FIG. 4 is a functional block diagram of an ink data processing system embodied in the hardware/software 100 of the computer 1, including a type one vector data generator 410, a type two vector data generator (a type one to type two converter) 430, and a selector 460 that selectively outputs type one vector data, type two vector data, or raw pen event data, depending on an output request.

The ink data processing system 100 receives raw data entered by the input device 10 a and may be processed by the motion event/touch input system 21 into pen event data (x, y, p). As described above, pen event data is device-dependent and may or may not include various attribute values (e.g., pressure and transparency parameters) associated with points entered by the input device 10 a.

The ink data processing system 100 communicates with an ink data application 300, such as a drawing application and an application that converts a pressure data (“P”) that may be included in the inputted pen event data into a width data (“W”) indicative of a variable width of a stroke represented by type one stroke object. Details of such application and methods for deriving width values (“W”) based on various attribute values are disclosed in the '182 application incorporated by reference above. Briefly, a process may be used to convert pressure data to width data based on a principle that a greater pressure applied by the input device 10 a against the position input sensor 50 indicates a wider stroke intended by the user and a lesser pressure indicates a thinner (less wide) stroke. Also disclosed in the '182 application is a process of converting speed data included in the inputted pen event data into width data. The process converts speed data, indicative of velocity at which the input device 10 a is moved at each point, to width data based on a principle that a higher velocity of the input device 10 indicates a thinner (less wide) stroke intended by the user and a lower velocity indicates a wider stroke. Still further disclosed in the '182 application is a process of converting a pressure value into a transparency value (“A”) based on a principle that a greater pressure applied by the input device 10 a against the position input sensor 50 indicates a darker (less transparent) stroke intended by the user and a lesser pressure indicates a more transparent stroke. Also disclosed in the '182 application is a process of converting a velocity value into a transparency value (“A”) based on a principle that a higher velocity of the input device 10 a indicates a more transparent (faint) stroke intended by the user and a lower velocity indicates a darker (less transparent) stroke.

The ink data application 300 may control operation of the ink data processing system 100 to generate type one vector data and type two vector data. The ink data application 300 may also control operation of the selector 460 to selectively output type one vector data, type two vector data, or raw event data. To this end the ink data application 300 may issue to the selector 460 control information indicative of the type of output request (either for type one or type two vector data, for example) and stroke IDs of those strokes that are requested to be outputted.

The ink data processing system 100 is coupled to a graphic processing section 40, which in turn is coupled to a sensor screen 50 a. The graphic processing section 40 receives type one vector data or type two vector data and outputs rasterized data comprising a set of pixel values at a defined resolution level including color (e.g., RGB) values of the pixels, which can then be directly displayed on a screen 50 a, such as an LCD (which is typically superposed on the position input sensor 50). For example, the graphic processing section 40 receives point objects that form a type one or type two stroke object, forms curves between the point objects used as control points according to a suitable curve interpolation algorithm such as a Catmull-Rom Curve algorithm and a Bezier Curve algorithm, and draws (renders) the resulting path (stroke) of the stroke object on the display 50 a using associated GPU libraries such as DirectX® and OpenGL® libraries.

In various examples, the motion event/touch input subsystem 21, ink data application 300, ink data processing system 100, and graphic processing section 40 coupled to VRAM may all be controlled by an OS running on the computer 1.

The type one vector data generator 410, under control of the ink data application 300, generates type one vector data based on the pen event data received from the position input sensor 50. An exemplary process of generating type one vector data includes generally three steps. First, pen event data detected by the position input sensor 50 is sequentially received. Second, point objects are sequentially generated based on coordinate values included in the received pen event data, wherein a point object is associated with width information (“W”). The point objects serve as control points for interpolating curve segments according to a defined curve interpolation algorithm, such as a Catmull-Rom Curve algorithm. Third, a type one stroke object is generated as a collection of the point objects that define a stroke represented by the type one stroke object. When pen event data includes color and/or transparency information indicative of the color and/or transparency value of each point, such information may also be sequentially obtained to generate point objects that are each associated with a color value and/or a transparency value. When raw pen event data already includes width values, no conversion is needed and the width values can be directly associated with the point objects, respectively. In exemplary embodiments of the present invention, a width value is indicative of a radius of a point object for use in defining a width of a stroke formed by the point object. Thus, by associating a set of point objects forming a stroke with varying width values, a type one stroke object having a variable width along its length can be generated. As used herein, a variable width means both that each point object can be associated with a varying width and that the point objects along the length of the stroke may have widths different from each other.

As shown in FIG. 4, type one vector data generated by the type one vector data generator 410 may then be stored in a memory device 450 as “Curve Data (P₁, . . . P_(n)), such as P1-P8 forming the type one stroke object 21 in FIG. 2.

Type one vector data includes one or more type one stroke objects, each being formed by a set of point objects, wherein each point object is associated with width information. The stored type one vector data may then be used by the type two vector data generator 430 to generate type two vector data, as will be described later. Alternatively, the stored type one vector data may be selectively outputted by the selector 460 in response to an output request for type one vector data, such as an output request from a text recognition application 300, or any application that requires the stroke to be rendered (reproduced) in the same order as how the stroke was initially inputted in the position input sensor 50. This is possible because, in various exemplary embodiments, type one stroke object 21 (see FIG. 2) is defined by a series of points that are arranged in the same sequential order as the sequential order in which the stroke represented by the stroke object is hand-drawn by the input device.

Additionally or alternatively to storing type one vector data in the memory device 450, the type one vector data generated by the type one vector data generator 410 may be outputted to a real-time renderer 420 to thereby start real-time rendering of each type one stroke object after its pen-down time before, or without waiting for, completion of the stroke object at its pen-up time. In other words, as the user draws a stroke on the position input sensor 50, a type one stroke object representative of the stroke is generated and rendered on the screen 50 a in real time so that the user can observe “growth” of a stroke from its initial point to a full length.

FIG. 5 is a functional block diagram of the type one vector data generator 410 of FIG. 4.

The type one vector data generator 410 receives the pen event data (X, Y, P (pressure)) at “A” and generates type one stroke objects, wherein each point object is associated with width information (W) at “D”. In exemplary embodiments, the type one vector data generator 410 continuously generates an increasing number of point objects as the pen event data is inputted. The type one vector data generator 410 continuously outputs the generated point objects to the real-time renderer 420 for real-time image rendering and/or to the memory device 450 for storage.

As shown in FIG. 5, the type one vector data generator 410 includes, or is coupled to, the memory device 450. The type one vector data generator 410 in the illustrated embodiment also includes a path (stroke) builder section 122B, which selects a suitable path builder based on a device type, a smoothener 122C, which starts to apply smoothing processing to a stroke object as it is generated before the stroke object is completed, an adding-to-stroke section 122D, which controls how many point objects should be added to a partially formed stroke object, and a suffixing section 122E, which fills in a gap (“Lag” in FIG. 6) at an end of a type one stroke object.

Point objects continuously generated and stored in memory 450 are used for real time rendering as fragments of a stroke object by the real-time renderer 420 (via “D” in FIG. 5). As such, the memory device 450 may be part of the real-time renderer 420 as opposed to being part of the type one vector data generator 410.

The path (stroke) builder section 122B is configured to select one path builder suited for a particular type of pen event data inputted. For example, if pen event data includes pen pressure values, a Pressure Path builder 122B1 is selected that includes a first (pressure) function f1 capable of deriving stroke width (W) and transparency (A) based on the pen pressure values. On the other hand, if pen event data does not include pen pressure values, a Velocity Path builder 12262 is selected. The Velocity Path builder 12262 includes a second (velocity) function f2 capable of deriving stroke width (W) and transparency (A) based on the pen movement speed, which is determined from the amount of change in the point coordinates or time stamps included in most pen event data. In other words, the Velocity Path builder 12262 substitutes velocity values for pressure values used in the Pressure Path builder 12261. The output from the path builder section 122B, which defines each point object with its XY coordinates and width (W) and, optionally, transparency (A) values, is indicated by “A(x)” in FIG. 5.

The smoothener 122C receives the point objects outputted from the path builder section 122B and applies a smoothing processing thereto. In various exemplary embodiments, the smoothener 122C starts to apply smoothing processing to a stroke object including point objects as the stroke object is being generated before it is completed. Any suitable smoothing processing or algorithm may be used, such as acceleration averaging, weight averaging, exponential smoothing, double-exponential smoothing, etc.

FIG. 6 illustrates the processing performed at points “A/A(x)” through “D” in the type one vector data generator 410 of FIG. 5. FIG. 6 illustrates smoothing processing applied by the smoothener 122C between row A and row B. Row A corresponds to point “A/A(x)” in FIG. 5 (before smoothing) and row B corresponds to point “B” in FIG. 5 (after smoothing). In row A, x1˜x10 represent coordinates of 10 points obtained from the pen event data. In FIG. 6, x1˜x10 are (10, 20, 30, 45, 60, 80, 90, 100, 110, 115).

In row B, x1′˜x10′ represent X coordinates of the 10 points after a smoothing processing has been applied. In the illustrated example, the following exponential smoothing function is applied.

X1′=α*X(t−1)+(1−α)*X(t−1)′  (Eq. 1)

where the filter strength α=0.5.

In FIG. 6, x1′˜x10′ are (10, 15, 23, 34, 47, 63, 77, 88, 99, 108).

The smoothing processing by the smoothener 122C is applied on a rolling basis to each of the points as their point coordinates are derived, to continuously output modified (smoothed) positions of these points. Thus, from the pen-down time at which a pen down event is detected, the type one vector data generator 410 may start to generate and output a partially formed, smoothed stroke object, before (without waiting for) the pen-up time at which a pen up event is detected.

In row B, point x0′ is added in the illustrated example where the Catmull-Rom Curve is used to define an interpolation curve between each pair of control points. As well known in the art, the Catmull-Rom Curve defines each curve segment with four control points including a start point (Pi), an end point (Pi+1), a point “before” the start point (Pi−1), and a point “after” the end point (Pi+2). Thus, to define a starting curve segment between points x1′ and x2′, the start point x1′ is duplicated to create a new point x0′ (at the same position as x1′) that may be used with points x1′, x2′ and x3′ as control points for defining the curve segment between x1′ and x2′. The position of the new point x0′ may be adjusted (curve-fitted) to a position where the Catmull-Rom Curve between x1′ and x2′ best fits the inputted stroke. By simply duplicating a value of x1′ (p1) to create a value of x0′ (p0), the process can instantly define a position of x0′ and set components of a vector from x0′ (p0) to x1′ (p1) as zero. The process is suited for real-time implementation (no need to wait for p2 to generate p0), and does not unduly influence the curvature of the curve segment between x1′ (p1) and x2′ (p2), such as undesirably pushing the curvature to one side or another.

Still referring to FIGS. 5 and 6, the suffixing section 122E fills in a gap (or “Lag”) between the inputted position at the end of a stroke object (x10, row A) and the smoothed position at the end of the stroke object (x10′, row B). In FIG. 6, row C illustrates the “Lag” filling (suffixing) operation. In the illustrated example, after the smoothing processing, a “Lag” is created between the originally inputted position x10 (115) and the smoothed position x10′ (108) at the end of the stroke object in row B. In exemplary embodiments, the type one vector data generator 410 is configured to determine whether to perform or not perform the suffixing operation depending on, for example, control information received from the ink data application 300. In other embodiments, the suffixing operation can be invoked every time a new point object is added to the stroke object, which may be suitable for the purpose of real-time rendering, for example.

If the suffixing operation is to be performed, in row C of FIG. 6, the suffixing section 122E adds new point objects at x11′, x12′ and x13′. Point x12′ is added at the same position as the originally inputted last position x10 (115) of row A. Point x11′ is added at a smoothed point between points x10′ and x12′. Finally, because in this example the Catmull-Rom Curve is used to define an interpolation curve between each pair of control points, the end point x12′ is duplicated to create a new point x13′ (at the same position as x12′), which is needed to define an ending curve segment between x11′ and x12′ as the Catmull-Rom Curve. The position of the new point x13′ may be adjusted (curve-fitted) to a position where the Catmull-Rom Curve between x11′ and x12′ best fits the inputted stroke. Also, even when the suffixing operation is not performed, if the Catmull-Rom Curve is used, the last smoothed point x10′ in row B may be duplicated to create a new point x10′ (new), which may be used with points x8′, x9′ and x10′ as control points to define the last curve segment between x9′ and x10′ in this case. By simply duplicating a value of x10′ to create a value of x10′ (new), the process can instantly define a position of x10′ at a neutral position, without unduly influencing the curvature of the curve segment between x9′ (p9) and x10′ (p10).

Referring back to FIG. 5, the adding-to-stroke section 122D determines (or keeps track of) how many of the point objects, which have been smoothed and perhaps suffixed, are stored in the memory device 450 and thus can be added to a partial data of the type one stroke object to be outputted. In the illustrated embodiment, point objects P1˜Pn-1 are stored in the memory device 450 and determined to be added to the partial data of the type one stroke object to be outputted to the real-time renderer 420 or to the memory device 450 (without waiting for completion of the entire type one stroke object). The real-time renderer 420 is capable of displaying the partially formed type one stroke object (as will be illustrated in FIG. 8). The memory device 450 will continuously store the partially formed type one stroke object until the entire type one stroke object is stored.

In FIG. 6, row D illustrates the type one stroke object, which has been smoothed (from row A to row B), and perhaps suffixed at the end (from row B to row C), and continuously outputted by the adding-to-stroke section 122D. The type one stroke object in the illustrated embodiment is defined to generate interpolation curves according to a Catmull-Rom Curve algorithm, wherein each curve segment (Pi−Pi+1) is defined by four control points (Pi−1, Pi, Pi+1, Pi+2) and the resulting curve passes through all of the control points, which is a characteristic of the Catmull-Rom Curve. Thus, the type one stroke object includes a starting curve segment (x1′-x2′) defined by four control points x0′, x1′, x2′, x3, and includes an ending curve segment (x11′-x12′) defined by four control points x10′, x11′, x12′, x13′.

FIG. 7 is a flow chart illustrating a sample process performed by the type one vector data generator 410. In step S701, the type one vector data generator 410 receives pen event data, which includes position coordinates (x, y) and timing information indicative of one of the following three types of timing:

1) Pen down time, when a pointer such as a finger or a pointing device (e.g., pen-type device) comes into contact with another (sensing) object;

2) Pen moving time, between a pen down time and a pen up time;

3) Pen up time, when a pointer is moved away (removed) from another (sensing) object.

1. A Processing Flow at Pen Down Time

In step S712, the type one vector data generator 410, based on control information (Set Input Dynamics 401 in FIG. 5) received from the ink data application 300 (see FIG. 4) for example, selects one path builder (e.g., 122B1 or 12262 in FIG. 5) out of a plurality of path builders to use to build a type one stroke object.

In step S714, the type one vector data generator 410, based on control information (Num_of_CHs 403) received from the application 300 for example, determines a set of parameters to be outputted from the path builder selected in step S712 above. A set of parameters to be outputted may be, for example, (x, y, W, A) and (x, y, W), where (x, y) are x, y coordinates of the point objects, W is a stroke width value, and A is alpha (α) indicative of transparency (or opacity). In addition to the 2D coordinates (x, y), a “z” value may be added to produce 3D coordinates for each point.

In step S716, the type one vector data generator 410, based on control information received from the application 300 for example (Use Smoothing, filter-strength 405), determines whether smoothing processing is to be applied to the set of parameters outputted from the selected path builder. The control information may also indicate to which ones of the parameters the smoothing processing is applied.

When application of the smoothing is indicated (YES to step S716), in step S718, the indicated smoothing processing is applied. Control information from the application 300 may additionally include sampling rate information of the position input sensor 50, which the type one vector data generator 410 may use to select a smoothing process of desired strength level. For example, when the sampling rate of the position input sensor 50 is lower (e.g., 10's of samples per second as opposed to 100's of samples per second, out of typically 60-240 samples per second), a stronger smoothing process having a greater smoothness value (effect) may be selected.

In step S720, as illustrated above in reference to FIG. 6, row B, the initial point (control point) x1′ is duplicated to generate a new control point x0′ for defining a starting curve segment between x1′ and x2′ as a Catmull-Rom Curve.

In step S772, the type one vector data generator 410 sends the smoothed initial (starting) curve segment of the type one stroke object to the real-time renderer 420 or to the memory device 450 depending on user command or control information from the application 300. A suitable curve interpolation algorithm such as the Catmull-Rom Curve algorithm is applied to build an interpolated curve using the smoothed point objects as control points.

2. A Processing Flow at Pen Moving Time

Returning back to the initial step S701 of the flow chart, when the type one vector data generator 410 detects pen moving time, i.e., the pen is moving between a start point and an end point, the type one vector data generator 410 receives the x, y coordinate values as well as time stamp and/or pen pressure information of a point as included in the pen event data, and uses the path builder selected in step S712 above to prepare and output a set of parameters (e.g., x, y, W, A) for the point as determined in step S714 above.

In step S730, the type one vector data generator 410, based on control information received from the application 300 for example, determines whether smoothing processing is to be applied to the received set of parameters (x, y, W, A) for the point. The control information may additionally indicate to which ones of the parameters the smoothing processing is applied. Operation of step S730 is the same as that of step S716 described above.

When application of the smoothing is indicated (YES to step S730), in step S732, the indicated smoothing process is performed. Also, depending on control information received from the application 300 for example, in step S733 the type one vector data generator 410 additionally performs the suffixing operation as shown in FIG. 6, row C. The suffixing operation is not mandatory and not necessarily performed in each operation. For example, when smoothing processing is not performed, suffixing operation is not needed and not performed.

In step S734, the type one vector data generator 410 uses the adding-to-stroke section 122D to determine how many of the point objects are established and stored in the memory device 450 to be added to a partial data of the type one stroke object to be outputted.

In step S776, the type one vector data generator 410 sends the smoothed middle curve segment of the type one stroke object to the real-time renderer 420 or to the memory device 450 in response to user command or control information from the application 300. A suitable curve interpolation algorithm such as the Catmull-Rom Curve algorithm is applied to build an interpolated curve using the smoothed point objects as control points. The middle curve segments are continuously outputted so that, for example, the real-time renderer 420 may display the middle portion of the type one stroke object in continuation to the initial portion of the type one stroke object outputted in step S772 above.

3. A Processing Flow at Pen Up Time

Returning back to the initial step S701 of the flow chart, when the type one vector data generator 410 determines the event type to be a pen up event (i.e., drawing of a type one stroke object is completed and the input device 10 is removed from the position input sensor 50), the type one vector data generator 410 receives the x, y coordinate values as well as time stamp and/or pen pressure information of a point as included in the pen event data, and uses the path builder selected in step S712 above to prepare and output a set of parameters (e.g., x, y, W, A) for the point as determined in step S714 above.

In step S750, the type one vector data generator 410 determines whether smoothing processing is to be applied to the received set of parameters, (x, y, W, A) for the point, as well as to which ones of the parameters the smoothing processing is applied. Operation of step S750 is the same as that of steps S716 and S730 described above.

When application of the smoothing is indicated (YES to step S750), in step S752, the indicated smoothing process is performed. Also, depending on control information received from the application 300 for example, the type one vector data generator 410 additionally performs the suffixing operation as shown in FIG. 6, row C. The suffixing operation is not mandatory and not necessarily performed in each operation. For example, when smoothing processing is not performed, suffixing operation is not needed and not performed.

In step S753, also as illustrated in FIG. 6, row C, the end point (control point) x12′ is duplicated to generate a new control point x13′ for defining an ending curve segment between x11′ and x12′ as a Catmull-Rom Curve.

In step S780, the type one vector data generator 410 sends the smoothed (and suffixed) ending curve segment of the type one stroke object to the real-time renderer 420 or to the memory device. A suitable curve interpolation algorithm such as the Catmull-Rom Curve algorithm is applied to build an interpolated curve using the smoothed and suffixed point objects as control points. The ending curve segment is outputted in continuation to the middle portion of the type one stroke object outputted above to thereby complete the type one stroke object as a whole.

The type one vector data generator 410 and the associated process as illustrated in FIG. 7 are thus capable of continuously inputting pen event data and outputting a partially formed type one stroke object as it is built. The outputted partial type one stroke object may be continuously stored in the memory device 450 or continuously sent to the real-time renderer 420 for real-time display (rendering) of the hand-drawn stroke represented by the type one stroke object.

FIG. 8 is a functional block diagram of the real-time renderer 420 and the graphic processing section 40, which together perform real-time rendering of type one vector data. The demarcation between the real-time renderer 420 and the graphic processing section 40 is not limited to what is illustrated in FIG. 8, and some of the functions may be combined, further divided, or differently shared between the real-time renderer 420 and the graphic processing section 40 depending on, for example, the rendering setting of each program application. In the exemplary embodiments as illustrated, however, those functions and calculations that can be hardware-accelerated are advantageously carried out in the graphic processing section 40 to support real-time rendering of type one vector data.

Type one vector data generated by the type one vector data generator 410 is inputted to the real-time renderer 420. In the illustrated example, type one vector data includes type one stroke objects each consisting of a set of point objects Pn each associated with width information “W.” When Catmull-Rom curves are used to define a type one stroke object, each curve segment of the type one stroke object is defined by four control points, as discussed above, in a sliding manner with each subsequent curve segment defined by four subsequent control points. As shown in FIG. 9A, the first curve segment is defined by four control points P0-P3 (901), the second curve segment is defined by four control points P1-P4 (902), and the (n-2)th curve segment is defined by four control points Pn-3-Pn (900 n). FIG. 9B illustrates input data from the type one vector data generator 410 ((Type 1) Curve Data) to the real-time renderer 420, as shown in FIG. 8, at any given time. FIG. 9B shows that, after receiving the four control points defining the curve segment Sn-1, the real-time renderer 420 receives the subsequent four control points 900 n defining the curve segment Sn.

The real-time renderer 420 segments each of the curve segments, as inputted, into a set of division points i (=0-n) as shown in FIG. 9C. The number and positions of division points i may be calculated, per each curve segment, taking into consideration, for example, pixel resolution of the display 50 a, contour/shape of the type one stroke object, etc. For example, the display pixel resolution may be considered to determine the optimal number and positions of the first segmentation points to be placed along each curve segment of the type one stroke object to achieve realistic rendition of the stroke on the display 50 a.

Specifically, each of the curve segments (e.g., Catmull-Rom curve segments) forming a type one stroke object is segmented by division point i between two (out of four) control points that define the curve segment. The resulting division points for each curve segment thus include the original control points (e.g., four control points for a Catmull-Rom curve segment) that define the curve segment and additional division points inserted between two adjacent control points. In other words, the division points reuse the original control points defined for the curve segment as inputted from the type one vector data generator 410, and additionally include “filler points” added to achieve a desired level of pixel resolution when the type one stroke object is rendered. After the division points i are determined for one or more curve segments forming a type one stroke object, a suitable smoothing algorithm, described above in reference to FIG. 7, may be applied to smooth out the division points. The resulting division points, including the original control points and the added filler points, are then used as vertices to be connected with straight lines to form triangles to be filled (see FIG. 9D).

As shown in FIG. 9A, application of the Catmull-Rom Curve algorithm to control points P0 . . . Pn will produce a curve 904. The curve 904 is formed to pass through all of the control points (P0 . . . Pn), which is a characteristic of the Catmull-Rom Curve.

When each division point is associated with a width value as in the illustrated embodiment of FIG. 9C, the width value is used to define a radius of a circle 905 (see FIG. 9A) centered around each division point (i.e., a control point for defining a curve segment) to thereby add a variable width to the stroke represented by the type one stroke object, as illustrated. As a width value for a division point, the width value(s) of the two original control point(s) may be used or a new width value calculated based on the original width value(s) may be used. For example, when filler points are added as the division points, width values for the filler points may be calculated based on a suitable interpolation method using known width values associated with the original control points (point objects) as inputted from the type one vector data generator 410. Similarly, other attribute values such as color and transparency values for the division points may be derived from the color and transparency values of the original control points.

The curve 904 with a variable width has a different width (or radius) at each of its control points (division points). One way to calculate the boundary of the curve 904 is to calculate an envelope 908 (908 a/908 b in FIG. 9C) of a set of circles centered on the control points (division points) along the length of the curve 904, wherein the radius (or diameter) of each circle corresponds to the width value associated with each division point i. Then the points that belong to the envelope 908 will satisfy the following conditions.

$\begin{matrix} \left\{ \begin{matrix} {{F\left( {x,y,t} \right)} = {\left( {x - {u(t)}} \right)^{2} + \left( {y - {v(t)}} \right)^{2} - {r(t)}^{2}}} \\ {\frac{{dF}\left( {x,y,t} \right)}{dt} = 0} \end{matrix} \right. & \left( {{Eq}.\mspace{14mu} 2} \right) \end{matrix}$

Further, when the Catmull-Rom Curve algorithm is used to interpolate the type one stroke object, the following polynomial functions u(t), v(t) and r(t) can be defined, wherein P_(i-3)-P_(i) define four control points needed to define each curve segment: a start point (P_(i-2)), an end point (P_(i-1)), a point “before” the start point (P_(i-3)), and a point “after” the end point (p_(i)).

$\begin{matrix} \left\{ \begin{matrix} {{u(t)} = {{{\frac{1}{2}\begin{bmatrix} 1 & t & t^{2} & t^{3} \end{bmatrix}}\begin{bmatrix} 0 & 2 & 0 & 0 \\ {- 1} & 0 & 1 & 0 \\ 2 & {- 5} & 4 & {- 1} \\ {- 1} & 3 & {- 3} & 1 \end{bmatrix}}\begin{bmatrix} {P_{0}\lbrack x\rbrack} \\ {P_{1}\lbrack x\rbrack} \\ {P_{2}\lbrack x\rbrack} \\ {P_{3}\lbrack x\rbrack} \end{bmatrix}}} \\ {{v(t)} = {{{\frac{1}{2}\left\lbrack \begin{matrix} 1 & t & t^{2} & t \end{matrix}^{3} \right\rbrack}\begin{bmatrix} 0 & 2 & 0 & 0 \\ {- 1} & 0 & 1 & 0 \\ 2 & {- 5} & 4 & {- 1} \\ {- 1} & 3 & {- 3} & 1 \end{bmatrix}}\begin{bmatrix} {P_{0}\lbrack y\rbrack} \\ {P_{1}\lbrack y\rbrack} \\ {P_{2}\lbrack y\rbrack} \\ {P_{3}\lbrack y\rbrack} \end{bmatrix}}} \\ {{r(t)} = {{{\frac{1}{2}\begin{bmatrix} 1 & t & t^{2} & t^{3} \end{bmatrix}}\begin{bmatrix} 0 & 2 & 0 & 0 \\ {- 1} & 0 & 1 & 0 \\ 2 & {- 5} & 4 & {- 1} \\ {- 1} & 3 & {- 3} & 1 \end{bmatrix}}\begin{bmatrix} {{P_{0}\lbrack w\rbrack}/2} \\ {{P_{1}\lbrack w\rbrack}/2} \\ {{P_{2}\lbrack w\rbrack}/2} \\ {{P_{3}\lbrack w\rbrack}/2} \end{bmatrix}}} \end{matrix} \right. & \left( {{Eq}.\mspace{14mu} 3} \right) \end{matrix}$

For each of the division points i, as shown in boxes 421 in FIG. 8, the real-time renderer 420 passes the definitions of the polynomials (Eq. 2) and (Eq. 3), and “left” (+1) and “right” (−1) indexes to the graphic processing section 40. Specifically, as shown in FIG. 9C, each division point i (t=i, where i=0, . . . n) is associated with its “left” coordinates (x1, y1) and its “right” coordinates (x2, y2), such that each curve segment defined by the set of division points i have two outline curves (or envelopes), one defined by a set of “left” coordinates and the other defined by a set of “right” coordinates.

Operation boxes 422 in the graphic processing section 40 solve (Eq. 2) and (Eq. 3) above to produce two “left” and “right” points (x1, y1) and (x2, y2) for each of the division points t_(i). Resulting sets of points (x₁, y₁) and (x₂, y₂) form the outline curves 908 a and 908 b that together envelop the stroke represented by the type one stroke object, as shown in FIG. 9C.

Boxes 423 in the graphic processing section 40 indicate envelope triangles 910 a, 910 b, etc., as shown in FIG. 9D, which are prepared by the operation boxes 422. Connecting the two sets of points (x₁, y₁) and (x₂, y₂) along the two outline curves 908 a and 908 b segments the stroke into multiple triangles 910 a, 910 b, etc., whose vertices are defined by the two sets of points (x₁, y₁) and (x₂, y₂).

Operation boxes 424 in the graphic processing section 40 then apply color values, which are typically associated with the control points (division points), respectively, to color the triangles 910 (910 a, 910 b, etc.) and hence pixels on the display 50 a. Any suitable coloring algorithm to color the triangles 910 may be applied, as apparent to those skilled in the art. The pixel color information is then outputted to VRAM for real-time rendering of the type one vector data on the display 50 a.

In general, real-time rendering of type one vector data, as described above, aims to fill the triangles 910 along the stroke path to achieve sequential rendering of the stroke in the same order as it is hand-drawn by the user. For example, referring back to the type one stroke object 21 of FIG. 2, as the user hand-draws the type one stroke object 21 from the “Pen down” point to the “Pen up” point, the user can observe real-time rendering of the stroke that starts at the “Pen down” point and grows continuously to terminate at the “Pen up” point on the display 50 a. As such, the real-time rendering approach entails overdrawing (over coloring) of the triangles 910 at any self-intersecting portions of the stroke, such as the self-intersection 21 a in FIG. 2. The real-time rendering approach permits overdrawing of the triangles 910 in favor of full hardware acceleration permitted by the graphic processing section 40, as described above. In some embodiments, a suitable blending function may be applied to prevent any visual artifacts that may be caused by overdrawing of the triangles 910, as will be apparent to those skilled in the art.

In view of the potential inefficiency due to overdrawing at self-intersecting portions, however, the embodiments of the present invention propose to prepare, based on type one vector data, type two vector data which does not include any self-intersection and thus does not suffer from inefficiency due to overdrawing of the triangles 910. The type two vector data generator 430 as shown in FIG. 4 may be used to generate such type two vector data based on type one vector data generated by the type one vector data generator 410. Thus, either type one vector data or type two vector data may be selectively outputted depending on a particular output request, so as to take full advantage of both the benefit of type one vector data and the benefit of type two vector data.

Referring back to FIG. 2, the type two stroke object 23, which is generated based on the type one stroke object 21 including self-intersection 21 a, consists of two shapes 23 a and 23 b each including no self-intersection. The process of converting a type one stroke object into a type two stroke object will be described below in reference to FIGS. 4 and 10-14B.

Referring back to FIG. 4, the type two vector data generator 430 receives type one vector data from the memory device 450, wherein type one vector data (or “Curve Data”) includes type one stroke objects each consisting of a set of point objects (P1-Pn). The type two vector data generator 430 generates type two vector data based on the received type one vector data, and outputs the generated type two vector data (or “Boundary” data (V1-Vm)) to the memory device 450. The selector 460 may then be used to selectively output type one vector data, type two vector data, or raw pen event data, all stored in the memory device 450, depending on a particular output request.

FIG. 10 is a functional block diagram of the type two vector data generator 430 (the type one to type two converter). The type two vector data generator 430 receives type one vector data (or “Curve Data” (P1-Pn)) from the memory device 450. As will be fully described below, various embodiments of the invention convert type one vector data usable with Catmull-Rom interpolation to type two vector data usable with cubic Bezier interpolation, which is one of the most common interpolation methods used in computer graphics.

In operation block 432 of FIG. 10, the type two vector data generator 430 segments each of the curve segments (e.g., Catmull-Rom Curve segments) forming a type one stroke object by “boundary points” between two control points that define the curve segment. In this connection, the operation in block 432 of FIG. 10 is similar to the operation of finding division points as described above in reference to FIG. 8.

Specifically, in block 432 of FIG. 10, the boundary points may be calculated, per each curve segment, taking into consideration, for example, pixel resolution of the display 50 a, contour/shape of the type one stroke object, etc. For example, the display pixel resolution may be considered to determine the optimal number and positions of the boundary points to be placed along each curve segment of the type one stroke object to achieve realistic rendition of the stroke on the display 50 a. The resulting boundary points include and reuse the original control points (P1-Pn) defined for the type one stroke object as inputted, and additionally include filler points added to achieve a desired level of pixel resolution when the resulting type two stroke object is rendered. For example, filler points may be added as boundary points to minimize the distance between the curve segments defined by the added filler points and the actual stroke's contours, for example, to be less than a certain pixel-size based threshold, although, unlike in the case of “division points” described above, the threshold may be relaxed in block 432 where high-resolution display typically required in connection with real-time rendering is not required. Also, in block 432, after the boundary points are determined, a suitable smoothing algorithm may be applied to smooth out the boundary points. The resulting boundary points, including the original control points and the added filler points, are then used as new control points to define curves such as the cubic Bezier curves. Block 432 of FIG. 10, similar to boxes 421 and 422 of FIG. 8, produces two sets of (left and right) envelope points (x₁, y₁) and (x₂, y₂), which collectively form outline curves 908 a and 908 b, which together envelop the stroke. As before, two points (x₁, y₁) and (x₂, y₂) are produced for each of the boundary points.

The resulting boundary points data, including the left and right envelope points calculated for each of the boundary points, may be optionally stored as “boundary data” of raw type, as shown in block 433. As in the case of the division points discussed above, each of the boundary points and its associated “left” and “right” point may be associated with attribute information, such as color and transparency values, which may be derived from the color and transparency values of the original control points (P1-Pn) based on which the boundary points were found.

In operation block 434, the type two vector data generator 430 simplifies the stroke enveloped by the two sets of points (x₁, y₁) and (x₂, y₂) along the two outline curves 908 a and 908 b into one or more simple polygons (or simple shapes), which form a type two stroke object as in block 435, according to exemplary embodiments of the invention. For example, block 434 simplifies the type one stroke object 21 including self-intersection 21 a as shown in FIG. 2 into a type two stroke object 23 consisting of two simplified shapes 23 a and 23 b each including no self-intersection as also shown in FIG. 2. The resulting type two stroke object is a set of curves (e.g., Bezier curves) defining a boundary of the stroke. In the example of FIG. 2, the type two stroke object 23 consists of two simple shapes 23 a and 23 b, wherein each of the simple shapes is defined by boundary points V1-V10 and V1-V6, respectively. The two sets of boundary points serve as control points to form Bezier curves, which form the exterior and interior boundaries of the stroke, respectively.

Various polygon clipping algorithms are known, which are suitable for clipping a given shape into one or more simple polygons including no self-intersection. Such algorithms include, as non-limiting examples, the Vatti polygon clipping algorithm disclosed in Bala R. Vatti, “A generic solution to polygon clipping,” Communications of the ACM, Vol. 35, Issue 7 (July 1992) pp. 56-63, and the Greiner-Hormann clipping algorithm, well known in the art. In particular, the Vatti clipping algorithm provides a highly general solution capable of clipping any concave, convex and self-intersection shapes to produce non-self-intersecting polygons and, as such, is highly suitable for use in various embodiments of the present invention.

Optionally, block 436 of FIG. 10 receives the simple polygons 435 including no self-intersection, and may apply a suitable curve fitting algorithm, such as the Philip J. Schneider algorithm as well known in the art, to the simple polygons 435, each being defined by a series of boundary points serving as control points to form curves. In some embodiments, a curve fitting may be previously applied in block 432, for example, and in such case additional curve fitting in block 436 may not be necessary. In various embodiments, boundary points that are particularly designed to facilitate accurate reproduction of the original shape of a hand-drawn stroke upon rendering may be added, such as boundary points added at corners 21 b of a shape of the stroke as shown in FIG. 2.

The type two vector data generator 430 thus completes generation of type two vector data including type two stroke objects, each being defined by a set boundary points, such as points V1-V10 of the simplified shape 23 a and points V1-V6 of the simplified shape 23 b in FIG. 2. The boundary points serve as control points to generate interpolated curves, which follow the contours of the simplified shapes 23 a and 23 b, using, for example, the cubic Bezier interpolation algorithm. The generated type two vector data may then be inputted to a 2D graphics library coupled to the graphic processing section 40 (FIG. 4) for rendering. Alternatively or additionally, the generated type two vector data may be stored in the memory device 450 to be later selectively outputted by the selector 460 in response to an output request.

As shown in FIG. 2, the simplified shapes 23 a and 23 b that together form the type two stroke object 23 are defined by the boundary points V1-V10 and V1-V6, respectively, which do not coincide with the sequential order in which the original stroke was hand-drawn. This is in contrast to the type one stroke object 21, also shown in FIG. 2, which is defined by the division points P1-P8 that are in the same sequential order in which the original stroke was hand-drawn. As such, the type two stroke object 23 in the illustrated embodiment is typically incapable of being reproduced in the same sequential order as how the original stroke was hand-drawn. However, because the type two stroke object consists of simple shapes that do not include any self-intersection, it is free of the inefficiency due to overdrawing of triangles 910 (see FIG. 9D) associated with the type one stroke object 21. This makes type two vector data highly efficient, in particular for the purpose of bulk rendering in which a (large) number of type two stroke objects need to be rendered and manipulated (zoomed, rotated, scrolled, tilted, etc.) in bulk (see 440 Bulk Rendering of pre-existing strokes in FIG. 4).

FIG. 11 is a schematic flow diagram illustrating conversion of a type one stroke object including self-intersection into a type two stroke object consisting of two simplified shapes including no self-intersection.

FIG. 12 is a flow chart illustrating a sample routine performed by the type two vector data generator 430 of FIG. 10. In step S1201, a received type one stroke object is segmented by boundary points, based on which two sets of points (x₁, y₁) and (x₂, y₂) for every boundary point are calculated to form two outline curves 908 a and 908 b that envelop the stroke. In step S1203, optionally, with respect to the boundary data of raw type (see block 433 in FIG. 10) wherein each boundary point V1, . . . Vn is associated with both a color value and a transparency (alpha) value, the color value of each boundary point (and of the left and right points of each boundary point) is adjusted using the transparency value of the same boundary point, which will be useful when embedding the generated type two vector data into a PDF file, as will be more fully described below in reference to FIGS. 13-14B.

In step S1205, polygon simplification is performed to simplify the type one stroke object into a type two stroke object consisting of one or more polygons each including no self-intersection. Each of the simple polygons is defined by a set of boundary points, which may be used as control points for generating interpolation curves using a suitable interpolation algorithm such as cubic Bezier interpolation. In step S1207, optionally, the boundary points may be adjusted (e.g., smoothed, or additional boundary points added to any corners of the simplified shapes). In step S1207, curve fitting may be applied to the boundary points, as needed.

FIG. 13 is a flow chart illustrating a routine to process the boundary data of raw type (see block 433 in FIG. 10) to generate type two vector data suited to be embedded in a PDF file. In step S1301, the routine receives pairs of points (x₁, y₁) and (x₂, y₂), each associated with color and transparency values, which are the left and right points of the boundary points. As discussed above, the color and transparency values of the points (x₁, y₁) and (x₂, y₂) based on the boundary points may be derived from the color and transparency values of the type one vector data (e.g., P1-Pn) used as an input for generating type two vector data.

Some applications, such as a PDF application, do not support a transparency value for each point being processed. Thus, in step S1303, the routine adjusts the color value of each (left and right) point by the alpha value of the same point to thereby incorporate or embed the transparency information into the color value alone. In step S1305, the routine outputs type two vector data wherein each boundary point, and hence its left and right points, is associated with an adjusted color value, which is a combination of, and thus is representative of, the original color value and the original transparency value.

FIGS. 14A and 14B schematically illustrate the process of generating type two vector data having adjusted color values, as described above in reference to the flow chart of FIG. 13. In the illustrated example, a first pair of points p1 a and p1 b and a second pair of points p2 a and p2 b correspond to the boundary data of raw type 433 (in FIG. 10), wherein each of the points p1 a, p1 b, p2 a and p2 b is defined by its XY coordinates and is associated with a color value and a transparency value (alpha). Typically, each pair of points has the same color and transparency values. For example, color and transparency values of points p1 a and p1 b based on a first boundary point (a black circle) are the same (as the color and transparency values of the first boundary point), and color and transparency values of points p2 a and p2 b based on a second boundary point are the same (as the color and transparency values of the second boundary point).

In step S1303 of FIG. 13, a color value of each of the points may be adjusted as follows:

Adjusted color=color+(1−alpha)*(1−color)  (Eq. 4)

Such adjustment typically results in an adjusted color that is whiter than the original color, assuming that background color is white (“FFFFFF”), resulting in improved blending of colors when rendered on a display.

In FIG. 14B, reference numeral 1401 indicates that the first three lines of data defining points p1 a, p1 b and p2 a form one triangle formed by these three points as vertices. When the color values of points p1 a, p1 b and p2 a are adjusted, as described above, a color of (or a color within) the triangle 560 a (see FIG. 14A) may be automatically calculated by PDF “ShadingType4 (Free-Form Gouraud-Shaded Triang meshes,” for example.

FIG. 15 is a flow chart illustrating a detailed routine of selectively outputting type one vector data, type two vector data, or type zero data (raw pen event data) depending on an output request.

In step S1501, a pen down event on the position input sensor 50 is detected. When a pen down event is detected, in step S1503, pen event data, (X, Y, P) for example, is obtained. In step S1505, the type one vector data generator 410 generates type one vector data based on the received pen event data, and the real-time renderer 420 starts real-time output of the generated type one stroke object (as it is being built from its pen-down point) without waiting for completion of the type one stroke object at is pen-up point. In step S1507, a pen up event is detected. If no, it means that the user's pen input operation continues and that the pen is down and moved on the position input sensor 50 and, thus, the routine returns to step S1501 to continue cycling through steps S1503-S1507.

In step S1507, if a pen up event is detected, it means that the user's input of a stroke has been completed (at its pen-up point). Then, in step S1509, the routine finalizes the type one stroke object, which represents the stroke from its pen-down point to the pen-up point, and may store the finalized type one stroke object in the memory device 450 (see FIG. 4).

In step S1511, the type two vector data generator 430 generates type two vector data based on the type one vector data finalized in step S1509 above, and stores the generated type two vector data in the memory device 450.

In step S1541, a type of an output request (“RT”) received from an application 300 (see FIG. 1B) being executed is determined.

If an output request (RT) is for type one vector data, in step S1547, type one vector data as stored in the memory device 450 is outputted. Output requests for type one vector data may include, for example, an output request from a text (character) recognition application, a signature verification application, a machine control application, and, more generally, any output request for ink data that can be rendered (reproduced) in the same order as how the stroke was initially inputted.

If an output request (RT) is for type two vector data, in step S1543, type two vector data as stored in the memory device 450 is outputted. Output requests for type two vector data may include, for example, an output request for bulk rendering involving zooming, rotating or tilting a set of strokes in bulk, and an output request to have the ink vector data embedded in a PDF file.

If an output request (RT) is for type zero data (raw pen event data), in step S1549, raw pen event data (e.g., “X, Y, P”) as stored in the memory device 450 is outputted. Output request for type zero data may include, for example, an output request from a signature verification application.

It should be appreciated by those skilled in the art that each of the elements, devices, steps and processes described above may be combined with other elements, devices, steps and processes, or may be further divided into sub-elements, sub-devices, sub-steps and sub-processes, depending on each implementation and application. Still further, the steps and processes may be executed in a single processor, or may be distributedly executed in multiple processors, depending on each implementation and application. 

1. A computer-implemented method of selectively outputting two types of vector data representative of user-input strokes, comprising: generating type one stroke objects in a device including a position input sensor, wherein the type one stroke objects represent strokes formed by a user operating a pointer relative to the position input sensor, and each type one stroke object represents a stroke starting at a pen-down time at which the pointer is detectably placed relative to the position input sensor and ending at a pen-up time at which the pointer is removed from the position input sensor; starting real-time rendering of a type one stroke object after the pen-down time of a stroke represented by said type one stroke object without waiting for completion of the stroke at the pen-up time; after completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, converting the type one stroke object to a type two stroke object, wherein the type two stroke object is a set of curves defining a boundary of the stroke; and rendering the type two stroke object, instead of the corresponding type one stroke object, after the pen-up time of the stroke represented by said type one stroke object.
 2. The computer-implemented method of claim 1, wherein the step of generating type one stroke objects includes: sequentially receiving pen event data detected by the position input sensor; sequentially generating point objects based on coordinate values included in the received pen event data, wherein the point objects serve as control points for interpolating curve segments according to a defined curve interpolation algorithm to form a type one stroke object and wherein each point object is associated with width information; and generating a type one stroke object as a collection of the point objects that define a stroke represented by the type one stroke object.
 3. The computer-implemented method of claim 2, wherein the step of generating type one stroke objects further includes: sequentially obtaining at least one of color values and transparency values for the point objects; and generating the type one stroke object as a collection of the point objects each associated with a color value and/or a transparency value.
 4. The computer-implemented method of claim 2, wherein the width information is indicative of a radius of a point object for use in defining a width of a stroke represented by the type one stroke object.
 5. The computer-implemented method of claim 2, wherein the defined curve interpolation algorithm is a Catmull-Rom Curve algorithm.
 6. The computer-implemented method of claim 2, wherein the step of starting real-time output of the type one stroke object includes: segmenting each curve segment of the type one stroke object into multiple division points i; applying the width information to each of the division points i to determine two outline curves forming the type one stroke object; and rendering the type one stroke object by rasterizing between the two outline curves.
 7. The computer-implemented method of claim 6, wherein the division points i are in the same sequential order as a sequential order in which the stroke represented by the type one stroke object is user-inputted from the pen-down time to the pen-up time.
 8. The computer-implemented method of claim 6, wherein the step of segmenting the curve segments into multiple division points i includes: as the division points, in addition to the control points, using filler points added to achieve a desired level of pixel resolution when the type one stroke object is rendered.
 9. The computer-implemented method of claim 6, wherein the step of starting real-time output of the type one stroke object further includes: after the step of segmenting the curve segments into multiple division points i, applying smoothing to rearrange the division points i.
 10. The computer-implemented method of claim 6, wherein the step of rendering the type one stroke object includes: defining a plurality of polygons between the two outline curves; and rasterizing the polygons.
 11. The computer-implemented method of claim 1, wherein the step of converting the type one stroke object to the type two stroke object includes: using a clipping algorithm, simplifying a shape of the type one stroke object into one or more simplified shapes that do not include self-intersection, wherein each simplified shape is defined by boundary points and the curves formed between the boundary points; and outputting the one or more simplified shapes as the type two stroke object comprised of the set of curves defining the boundary of the stroke.
 12. The computer-implemented method of claim 11, wherein the clipping algorithm is a Vatti clipping algorithm or a Greiner-Hormann algorithm.
 13. The computer-implemented method of claim 11, wherein the boundary points are not in the same sequential order as a sequential order in which the stroke represented by the type two stroke object is user-inputted from the pen-down time to the pen-up time.
 14. The computer-implemented method of claim 11, wherein the step of simplifying the shape of the type one stroke object includes: placing the boundary points at corners of the one or more simplified shapes.
 15. The computer-implemented method of claim 11, wherein the step of simplifying the shape of the type one stroke object includes: applying smoothing to rearrange the boundary points.
 16. The computer-implemented method of claim 11, wherein the step of converting the type one stroke object to the type two stroke object further includes: applying curve fitting to the type two stroke object.
 17. The computer-implemented method of claim 11, wherein the step of outputting the one or more simplified shapes as the type two stroke object includes: rendering the type two stroke object on a display.
 18. The computer-implemented method of claim 11, wherein the curves formed between the boundary points are Bezier curves.
 19. The computer-implemented method of claim 1, further comprising: storing the type one stroke objects; storing the type two stroke objects; and selectively outputting the type one stroke objects or the type two stroke objects depending on an output request.
 20. The computer-implemented method of claim 19, further comprising: outputting the type one stroke objects in response to an output request from applications including a real-time drawing application and a text recognition application; and outputting the type two stroke objects in response to an output request from applications including a bulk drawing application and a portable document format (PDF) application.
 21. The computer-implemented method of claim 11, further comprising: adjusting a color value of each boundary point based on the color value and a transparency value of the boundary point; and outputting the boundary points associated with adjusted color values in response to an output request from a portable document format (PDF) application.
 22. A system of selectively outputting two types of vector data representative of user-input strokes, comprising: a memory device; a processor coupled to the memory device, wherein the processor is configured to perform: receiving pen event data from a position input sensor, the pen event data being representative of strokes formed by a user operating a pointer relative to the position input sensor, each stroke starting at a pen-down time at which the pointer is detectably placed relative to the position input sensor and ending at a pen-up time at which the pointer is removed from the position input sensor; generating type one stroke objects based on the received pen event data, wherein the type one stroke objects represent the strokes, respectively; starting real-time rendering of a type one stroke object after the pen-down time of a stroke represented by said type one stroke object without waiting for completion of the stroke at the pen-up time; after completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, converting the type one stroke object to a type two stroke object, wherein the type two stroke object includes a set of curves defining a boundary of the stroke; and rendering the type two stroke object, instead of the corresponding type one stroke object, after the pen-up time of the stroke represented by said type one stroke object.
 23. The system of claim 22, wherein the processor further performs: storing the type one stroke objects in the memory device; storing the type two stroke objects in the memory device; and selectively outputting the type one stroke objects or the type two stroke objects depending on an output request.
 24. A computer-implemented method of selectively outputting two types of vector data representative of user-input strokes, comprising: generating type one stroke objects in a device including a position input sensor, wherein the type one stroke objects represent strokes formed by a user operating a pointer relative to the position input sensor, and each type one stroke object represents a stroke starting at a pen-down time at which the pointer is detectably placed relative to the position input sensor and ending at a pen-up time at which the pointer is removed from the position input sensor; starting real-time rendering of a type one stroke object after the pen-down time of a stroke represented by said type one stroke object without waiting for completion of the stroke at the pen-up time; after completion of a type one stroke object representative of a stroke from its pen-down time to its pen-up time, converting the type one stroke object to a type two stroke object, wherein the type two stroke object is a set of boundary points that represent a boundary of the entire stroke; and rendering the type two stroke object, instead of the corresponding type one stroke object, after the pen-up time of the stroke represented by said type one stroke object.
 25. The computer-implemented method of claim 24, further comprising: storing the type one stroke objects; storing the type two stroke objects; and selectively outputting the type one stroke objects or the type two stroke objects depending on an output request. 